home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_DrawBackFore.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  1KB  |  58 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. #ifdef DO_TAPEDECK_KIND
  10. VOID __regargs
  11. LTP_DrawBackFore(struct RastPort *RPort,BOOLEAN Back,LONG Left,LONG Top,LONG Width,LONG Height)
  12. {
  13.     LONG i,Len,Start,ArrowWidth,ArrowHeight,Shift;
  14.  
  15.     ArrowWidth    = Width / 2;
  16.     ArrowHeight    = Height;
  17.     Left        = Left + (Width - ArrowWidth) / 2;
  18.     Shift        = ArrowWidth / 2;
  19.  
  20.     if(Back)
  21.     {
  22.         for(i = 0 ; i < ArrowWidth ; i++)
  23.         {
  24.             Len    = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  25.  
  26.             if(Len < ArrowHeight)
  27.                 Len++;
  28.  
  29.             Start    = Top + (ArrowHeight - Len) / 2;
  30.  
  31.             Move(RPort,Left + i - Shift,Start);
  32.             Draw(RPort,Left + i - Shift,Start + Len - 1);
  33.  
  34.             Move(RPort,Left + i + Shift,Start);
  35.             Draw(RPort,Left + i + Shift,Start + Len - 1);
  36.         }
  37.     }
  38.     else
  39.     {
  40.         for(i = 0 ; i < ArrowWidth ; i++)
  41.         {
  42.             Len    = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  43.  
  44.             if(Len < ArrowHeight)
  45.                 Len++;
  46.  
  47.             Start    = Top + (ArrowHeight - Len) / 2;
  48.  
  49.             Move(RPort,Left + ArrowWidth - 1 - i - Shift,Start);
  50.             Draw(RPort,Left + ArrowWidth - 1 - i - Shift,Start + Len - 1);
  51.  
  52.             Move(RPort,Left + ArrowWidth - 1 - i + Shift,Start);
  53.             Draw(RPort,Left + ArrowWidth - 1 - i + Shift,Start + Len - 1);
  54.         }
  55.     }
  56. }
  57. #endif    /* DO_TAPEDECK_KIND */
  58.